#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>


int DigitSum(int x,int* sum) {
	if (x < 10) {
		(*sum) += x % 10;
		return x;
	}
		
	else {
		(*sum) += x % 10;
		return DigitSum(x / 10,sum);
	}
}

int main() {
	int x = 0;
	int sum = 0;
	scanf("%d", &x);
	DigitSum(x,&sum);
	printf("sum=%d", sum);
	return 0;
}